Cache used both as cache and staging buffer

ABSTRACT

In one embodiment, a cache comprises a data memory comprising a plurality of data entries, each data entry having capacity to store a cache block of data, and a cache control unit coupled to the data memory. The cache control unit is configured to dynamically allocate a given data entry in the data memory to store a cache block being cached or to store data that is not being cache but is being staged for retransmission on an interface to which the cache is coupled.

BACKGROUND

1. Field of the Invention

This invention is related to the field of caches.

2. Description of the Related Art

Caches are included in systems to reduce the latency of read/writeoperations from data consumers such as processors and other devices incomputer systems (where a data consumer reads data from the main memoryin the system, and sometimes writes data to memory as well). Typically,a cache has a relatively small capacity compared to the main memory, andhigh speed memory is used to build the cache. Data recently accessed bythe data consumer(s) is typically stored in the cache, in units of cacheblocks. That is, cache storage is typically allocated and deallocated incache-block-sized units. The cache blocks are address aligned to naturalcache block boundaries in the memory address space.

In addition to caches, buffering is typically provided in the system,between the data consumer(s) and the cache and/or between the cache andthe memory system. Buffers are used to temporarily stage data fortransfer. Such buffers are often costly in both area and latency.

SUMMARY

In one embodiment, a cache comprises a data memory comprising aplurality of data entries, each data entry having capacity to store acache block of data, and a cache control unit coupled to the datamemory. The cache control unit is configured to dynamically allocate agiven data entry in the data memory to store a cache block being cachedor to store data that is not being cached but is being staged forretransmission on an interface to which the cache is coupled.

In an embodiment, a method comprises receiving data in a cache, the databeing staged for retransmission on an interface to which the cache iscoupled; and dynamically allocating a given data entry in a data memoryof the cache to store the staged data, the given data entry having acapacity to store a cache block being cached and also useable to cachethe cache block.

BRIEF DESCRIPTION OF THE DRAWINGS

The following detailed description makes reference to the accompanyingdrawings, which are now briefly described.

FIG. 1 is a block diagram of one embodiment of a system.

FIG. 2 is a block diagram of one embodiment of an IOC shown in FIG. 1.

FIG. 3 is a table illustrating allocation of data entries in oneembodiment of the IOC.

FIG. 4 is a block diagram of a second embodiment of the IOC.

FIG. 5 is an example using an embodiment of FIG. 4.

FIG. 6 is a flow diagram illustrating various operations of oneembodiment of the IOC.

While the invention is susceptible to various modifications andalternative forms, specific embodiments thereof are shown by way ofexample in the drawings and will herein be described in detail. Itshould be understood, however, that the drawings and detaileddescription thereto are not intended to limit the invention to theparticular form disclosed, but on the contrary, the intention is tocover all modifications, equivalents and alternatives falling within thespirit and scope of the present invention as defined by the appendedclaims.

DETAILED DESCRIPTION OF EMBODIMENTS

Turning now to FIG. 1, a block diagram of one embodiment of a system 10is shown. In the illustrated embodiment, the system 10 includes one ormore processors such as processors 18A-18B, one or more memorycontrollers such as memory controllers 20A-20B, an I/O bridge (IOB) 22,an I/O memory (IOM) 24, an I/O cache (IOC) 26, a level 2 (L2) cache 28,an interconnect 30, a DMA controller 14, a peripheral interfacecontroller 32, one or more media access control circuits (MACs) such asMACs 34A-34B, and a physical interface layer (PHY) 36. The processors18A-18B, memory controllers 20A-20B, IOB 22, IOC 26, and L2 cache 28 arecoupled to the interconnect 30. The IOB 22 is further coupled to the IOC26 and the IOM 24. The IOC 26 is also further coupled to the IOM 24. TheDMA controller 14 is also coupled to the IOB 22 and the IOM 24. The MACs34A-34B are coupled to the DMA controller 14 and to the physicalinterface layer 36. The peripheral interface controller 32 is alsocoupled to the I/O bridge 22 and the IOM 24 (and thus indirectly coupledto the DMA controller 14) and to the physical interface layer 36. Insome embodiments, the components of the system 10 may be integrated ontoa single integrated circuit as a system on a chip. In other embodiments,the system 10 may be implemented as two or more integrated circuits.

The IOC 26 may be a cache for I/O-generated transactions, e.g. from theperipheral interface controller 32 and/or from the DMA controller 14, onbehalf of the MACs 34A-34B. The DMA controller 14 may also generatetransactions to perform memory to memory DMA copy operations, in oneembodiment. Additionally, the IOC 26 may allocate data entries in itsdata memory to stage data received from the interconnect 30 forretransmission to I/O and/or to stage data received from I/O to beretransmitted on the interconnect 30. More particularly, the IOC 26 maydynamically allocate data entries in the data memory to store a cacheblock provided in a fill (due to a cache miss) or to store staged data.Data may be viewed as “staged” if it is not being cached for future (andpossibly repeated) access, but rather is in transit and is being heldonly until the data can be transmitted onto the target interface. Incontrast, cached data generally remains cached until replaced by morerecently accessed data (eviction), forced flush for coherency purposes,or explicitly flushed under, e.g., program control.

By using IOC 26 storage for staging data, separate buffering may beavoided. Data may be directly transferred between the data memory of theIOC 26 and the interconnect 30. The number of staging buffers availablemay also be relatively larger (e.g. some significant percentage of theIOC 26, for example), and may dynamically vary based on the trafficactually experienced in the system 10.

More specifically, in the illustrated embodiment, the IOC 26 may serveto stage data at the boundary between coherent transactions (on theinterconnect 30) and non-coherent I/O transactions. The staged data maybe flowing in either direction (from the interconnect 30 to I/O or fromI/O to the interconnect 30) and may correspond to a transaction sourcedeither on the interconnect 30 or in an I/O device.

In some embodiments, the IOC 26 may stage data from the interconnect 30to the I/O components (the peripheral interface controller 32 and theDMA controller 14, in this embodiment). Generally, the IOC 26 may stagedata to be transferred from one interface to another interface. In thisembodiment, the IOM 24 may be used as a buffer for data beingtransferred between the IOC 26 and the peripheral interface 32 or theDMA controller 14. Thus, the data path between the interconnect 30 andthe DMA controller 14/peripheral interface controller 32 may be throughthe IOC 26 and the IOM 24. The control path (including read/writerequests, addresses in the host address space associated with therequests, etc.) may be between the IOB 22 (and the IOC tags) and the DMAcontroller 14/peripheral interface controller 32. The IOM 24 may not beincluded in other embodiments, and the IOM 24 buffering may becompletely absorbed into the IOC 26. That is, in such embodiments, thedata path may be from the interconnect 30 to the IOC 26 to the DMAcontroller 14/peripheral interface controller 32.

The processors 18A-18B comprise circuitry to execute instructionsdefined in an instruction set architecture implemented by the processors18A-18B. Any instruction set architecture may be implemented in variousembodiments. For example, the PowerPC™ instruction set architecture maybe implemented. Other exemplary instruction set architectures mayinclude the ARM™ instruction set, the MIPS™ instruction set, the SPARC™instruction set, the x86 instruction set (also referred to as IA-32),the IA-64 instruction set, etc.

The memory controllers 20A-20B comprise circuitry configured tointerface to memory. For example, the memory controllers 20A-20B may beconfigured to interface to dynamic random access memory (DRAM) such assynchronous DRAM (SDRAM), double data rate (DDR) SDRAM, DDR2 SDRAM,Rambus DRAM (RDRAM), etc. The memory controllers 20A-20B may receiveread and write transactions from the interconnect 30 for the memory towhich they are coupled, and may perform the read/write operations to thememory. The read and write transactions may include read and writetransactions initiated by the IOB 22 on behalf of the DMA controller 14and/or the peripheral interface controller 32. Additionally, the readand write transactions may include transactions generated by theprocessors 18A-18B and/or the L2 cache 28.

The L2 cache 28 may comprise a cache memory configured to cache copiesof data corresponding to various memory locations in the memories towhich the memory controllers 20A-20B are coupled, for low latency accessby the processors 18A-18B and/or other agents on the interconnect 30.The L2 cache 28 may comprise any capacity and configuration (e.g. directmapped, set associative, etc.).

The IOB 22 comprises circuitry configured to communicate transactions onthe interconnect 30 on behalf of the DMA controller 14 and theperipheral interface controller 32. The interconnect 30 may supportcache coherency, and the IOB 22 may participate in the coherency andensure coherency of transactions initiated by the IOB 22. In theillustrated embodiment, the IOB 22 employs the IOC 26 to cache recenttransactions initiated by the IOB 22. The IOC 26 may have any capacityand configuration, in various embodiments, and may be coherent. The IOC26 may be used, e.g., to cache blocks of data which are only partiallyupdated due to reads/writes generated by the DMA controller 14 and theperipheral interface controller 32. Using the IOC 26, read-modify-writesequences may be avoided on the interconnect 30, in some cases.Additionally, transactions on the interconnect 30 may be avoided for acache hit in the IOC 26 for a read/write generated by the DMA controller14 or the peripheral interface controller 32 if the IOC 26 hassufficient ownership of the cache block to complete the read/write.

The interconnect 30 may comprise any communication medium forcommunicating among the processors 18A-18B, the memory controllers20A-20B, the L2 cache 28, and the IOB 22. For example, the interconnect30 may be a bus with coherency support. The interconnect 30 mayalternatively be a point-to-point interconnect between the above agents,a packet-based interconnect, or any other interconnect.

The DMA controller 14 is configured to perform DMA transfers between theinterface circuits (e.g. the peripheral interface controller 32 and MACs34A-34B) and the memory address space. Particularly, the DMA transfersmay be between memory locations to which the address space is mapped (inmemory attached to the memory controllers 20A-20B, for example) and theinterface circuits. Additionally, the DMA controller 14 may, in someembodiments, be configured to perform DMA transfers between sets ofmemory locations within the address space. That is, both the source anddestination of such a DMA transfer may be memory locations. The DMAcontroller 14 may be configured to perform one or more operations (or“functions”) on the DMA data as the DMA data is being transferred, insome embodiments. In one embodiment, some of the operations that the DMAcontroller 14 performs are operations on packet data (e.g.encryption/decryption, cyclical redundancy check (CRC) generation orchecking, checksum generation or checking, etc.). The operations mayalso include an exclusive OR (XOR) operation, which may be used forredundant array of inexpensive disks (RAID) processing, for example.

The MACs 34A-34B may comprise circuitry implementing the media accesscontroller functionality defined for network interfaces. For example,one or more of the MACs 34A-34B may implement the Gigabit Ethernetstandard. One or more of the MACs 34A-34B may implement the 10 GigabitEthernet Attachment Unit Interface (XAUI) standard. Other embodimentsmay implement other Ethernet standards, such as the 10 Megabit or 100Megabit standards, or any other network standard. In one implementation,there are 6 MACs, 4 of which are Gigabit Ethernet MACs and 2 of whichare XAUI MACs. Other embodiments may have more or fewer MACs, and anymix of MAC types.

The peripheral interface controller 32 comprises circuitry configured tocontrol a peripheral interface. In one embodiment, the peripheralinterface controller 32 may control a peripheral component interconnect(PCI) Express interface. Other embodiments may implement otherperipheral interfaces (e.g. PCI, PCI-X, universal serial bus (USB),etc.) in addition to or instead of the PCI Express interface.

The PHY 36 may generally comprise the circuitry configured to physicallycommunicate on the external interfaces to the system 10 under thecontrol of the interface circuits 16. In one particular embodiment, thePHY 36 may comprise a set of serializer/deserializer (SERDES) circuitsthat may be configured for use as PCI Express lanes or as Ethernetconnections. The PHY 36 may include the circuitry that performs 8 b/10 bencoding/decoding for transmission through the SERDES andsynchronization first-in, first-out (FIFO) buffers, and also thecircuitry that logically configures the SERDES links for use as PCIExpress or Ethernet communication links. In one implementation, the PHYmay comprise 24 SERDES that can be configured as PCI Express lanes orEthernet connections. Any desired number of SERDES may be configured asPCI Express and any desired number may be configured as Ethernetconnections.

It is noted that, in various embodiments, the system 10 may include oneor any number of any of the elements shown in FIG. 1 (e.g. processors,memory controllers, caches, I/O bridges, DMA controllers, and/orinterface circuits, etc.).

Turning now to FIG. 2, a block diagram of one embodiment of the IOC 26is shown in more detail. The IOC 26, in the embodiment of FIG. 2,includes a cache tag memory 40, a cache data memory 42, and a cachecontrol unit 44. The cache control unit 44 includes a free list 46. Thecache tag memory 40 is coupled to receive addresses for transactions onthe interconnect 30 and to receive addresses for transactions from theIOB 22 (and received by the IOB 22 from the DMA controller 14 and/or theperipheral interface controller 32). The cache data memory 42 is coupledto receive data or provide data for the transactions from theinterconnect 30 and the IOM 24. The cache control unit 44 is coupled tothe tag memory 40 and the data memory 42, and to receive various controlinformation related to the transactions received in the IOC 26.

The data memory 42 may comprise a set of data entries, each havingcapacity to store a cache block of data. The data memory 42 may comprisea RAM, for example, indexed by entry number. The cache tag memory 40 maycomprise a set of tag entries, each configured to store an address tagand other state related to its corresponding data entry. The cache tagmemory 40 may also comprise a RAM. Alternatively, the cache tag memory40 may comprise a content addressable memory (CAM) for snoopingpurposes, or a RAM/CAM combination.

The cache control unit 44 may dynamically allocate a data entry in thedata memory 42 to store data for a transaction received by the IOC 26.The transaction may be an I/O write to memory, for example, receivedfrom the IOB 22/IOM 24. The transaction may also be a read completion(with data) provided from the IOB/IOM 24 in response to a readpreviously received from the interconnect 30 and targetting I/O. Thetransaction may be a write received from the interconnect 30 thattargets I/O. Additionally, the transaction may be a read completion fora read from an I/O device to memory.

The transaction may be considered either cacheable or non-cacheable, buta data entry may be provided in the data memory 42 in either case. Ifthe transaction is non-cacheable (either because of the type oftransaction, software-controlled restrictions such as translationattributes, or due to IOC 26 caching policies), the allocated entry isused as a buffer. If the transaction is cacheable and a cache miss, theallocated entry is used as a cache entry. If the transaction iscacheable and a cache hit, an entry is not allocated and the hittingentry may be updated (or data may be provided from the hitting entry).Thus, at any given point in time, a given data entry in the data memory42 may be serving as a cache entry or as a staging buffer entry. Thatis, data entries are not statically assigned to buffer or cache use, inthis embodiment.

In the illustrated embodiment, the cache control unit 44 implements afree list 46 to track which data entries are currently free and whichare currently allocated. The free list 46 may comprise a free list valuefor each entry, which may indicate allocated or free. For example, thefree list value may be a bit indicating allocated in one state (set orclear) and free in the other state. In such an embodiment, the free listmay be a bit vector having a specified bit position for each data entryin the data memory 42. The free list 46 may comprise a register or otherstorage storing the free list value for each data entry.

The cache tag 40 stores tags for the cache blocks cached in the IOC 26,along with other cache state. For example, since the IOC 26 ismaintained coherent on the interconnect 30, the cache state may includethe various coherence states implemented in the coherence scheme on theinterconnect 30. In one embodiment, a modified, exclusive, shared,invalid (MESI) or modified, owned, exclusive, shared, invalid (MOESI)scheme may be implemented. Other embodiments may implement any otherscheme, or subsets of any scheme, as desired.

Staged data in the data memory 42 may not yet be coherent with theinterconnect 30, or may not be coherent at all (e.g. data moving towardI/O). Accordingly, in this embodiment, the tag entries that correspondto data entries storing staged data may be marked invalid, even thoughthe free list indicates that the data entry is allocated. Accordingly,the tag memory 40 may be snooped for coherence purposes, and no snoophit will be detected for entries that are storing staged data. Ingeneral, each tag entry may include validity indication, comprising oneor more bits per entry. For example, the validity indication may be avalid bit, indicating valid or invalid with set and clear states.Alternatively, the validity indication may be the cache state, with theinvalid state indicating invalid and any other state (shared, exclusive,etc.) indicating valid. Any validity indication may be used. For theremainder of this disclosure, the cache state will be used as an exampleof a validity indication.

The combination of the cache state in the corresponding tag entry andthe free list state for a data entry may indicate the current state ofthe data entry, in this embodiment. For example, the table in FIG. 3illustrates the combinations of values and the corresponding currentstate of the data entry, for one embodiment. If the free list value forthe data entry indicates free, then the data entry is not currently inuse and is available to be allocated. The cache state is a don't care ifthe free list value indicates free, in this embodiment. If the free listvalue for the data entry is allocated and the cache state in thecorresponding tag entry is invalid, the data entry is in use as astaging buffer. If the free list value for the data entry is allocatedand the cache state in the corresponding tag entry is valid, then thedata entry is in use as a cache entry.

The IOC 26 may have any configuration. Particularly, in one embodiment,the IOC 26 may be fully associative (in which any entry of the cache maybe used to cache any address). Such a structure may be used, e.g., forrelatively small capacities. For example, 128 entries may be implementedin a full associative configuration, in one embodiment. Both cacheblocks and staging buffer entries may be freely allocated across thefully associative entries. For larger capacities of the IOC, timing andpower consumption considerations may make the fully associativeconfiguration less feasible. In such embodiments, a direct mapped or setassociative configuration may be implemented.

In typical direct mapped and set associative caches, there is apreconfigured, one-to-one correspondence between tag entries and dataentries. In a direct mapped configuration, each address maps to onepossible entry (tag and data) in the cache, at which the correspondingcache block would be stored. If that entry was allocated to store stageddata, then that entry could not be used to cache data until the stageddata has been transmitted. Similarly, in a set associativeconfiguration, each address maps to two or more possible entries(dependent on the associativity of the cache). However it is possiblethat all entries in a set could be allocated to staging buffer use.Performance may be impacted negatively in such cases, e.g. if the datathat cannot be cached is frequently accessed.

FIG. 4 is block diagram of another embodiment of the IOC 26, includingthe cache tag memory 40, the cache data memory 42, and the cache controlunit 44 (including the free list 46) as shown in the embodiment of FIG.2 and coupled as shown in FIG. 2. Additionally, a tag/data entry table48 is shown, coupled in parallel with the cache tag memory 40 to receiveaddresses of transactions and coupled to the cache control unit 44.

In the embodiment of FIG. 4, the tag/data entry table 48 may be used tomap a given tag entry (and thus the address tag stored therein) to acache data entry. Accordingly, the tag/data entry table 48 may providethe link between a tag entry and a data entry, rather then a fixedmapping. The table 48 may be updated by the cache control unit 44. Thecache tag memory 40 may be designed as normal, having the configurationof the IOC 26 (e.g. direct mapped or set associative). The cache datamemory 42 may have a different configuration (e.g. a RAM indexed byentry number). When a tag entry is allocated to a cache block to bestored in the IOC 26, the cache control unit 44 may allocate a dataentry using the free list 46. The cache control unit 44 may update thetag/data entry table 48 to link the tag entry and the allocated dataentry. When a data entry is allocated for staging buffer use, thetag/data entry table 48 may not be updated, and there may not be a tagentry for the corresponding data entry. Some cache entries may beunavailable for use, if all data entries are in use as staging buffersat the time a cache allocation is attempted. However, the flexibleallocation of data entries may reduce the likelihood that a cacheabletransaction is blocked from caching or causes other cache data to beevicted so that the newly received data can be cached.

In one embodiment, the tag/data entry table 48 is congruent with thecache tag memory 40 (that is, it has the same configuration in terms ofrows and columns of entries). The table entry corresponding to a giventag entry may store a pointer to the data entry in the data memory 42that is assigned to store the cache block that is tagged by the giventag entry. Thus, data entries may be freely allocated to cache blocks orstaging buffers, as desired. The pointer may have any form, depending onthe construction of the cache data memory 42. For example, the pointermay be an entry number, an entry number and way if the data memory isset associative, etc.

FIG. 5 is an example illustrating the use of the tag/data entry table48. In the example, the tag memory 40 (and thus the IOC 26) is 4 way setassociative and the cache data memory 42 is a RAM indexed by entrynumber. Two sets of the cache tag memory 40 are shown, as are twocorresponding rows of the tag/data entry table 48. In the example, thereare three cache blocks represented by tags (C₁, C₂, and C₃ in FIG. 5).For each entry in the tag memory 40, a corresponding entry in thetag/data entry table 48 entry has a pointer to an entry in the datamemory 42. Specifically, cache block C₁ has a corresponding pointer P₁,cache block C₂ has a corresponding pointer P₂, and cache block C₃ has acorresponding pointer P₃. As shown by the arrows in FIG. 5, each pointermay point to any entry in the cache data memory 42 (storing cache blockCD₁, cache block CD₂, and cache block CD₃, respectively, in FIG. 5).

Additionally, a data entry is shown storing staged data (BD₁) in FIG. 5.The staged data occupies a data entry 50 in the data memory 42.Accordingly, the data entry 50 may be unavailable for allocation tostore a cache block, until the staged data is transmitted. There is nopointer in the tag/data entry table 48 to the data entry 50, but thefree list value for the entry shows allocated. In the example, the freelist value is a bit, which is clear to indicate allocated and set toindicate available. The free list 46 is illustrated as a bit vector tothe right of the data memory 42.

Accordingly, the cache control unit 44 may dynamically allocate any dataentry for staging buffer or cache use, and may be permitted to cachedata for any given index (and way) in the data memory 42 as well.

While the tag/data entry table 48 is shown separately in FIGS. 4 and 5,other embodiments may implement the table in the cache tag memory 42(e.g. each tag entry may include the pointer to the allocated dataentry). In some embodiments, portions of the IOC 26 may be integratedinto the IOB 22. For example, the tag memory and cache controller may beintegrated. In such embodiments, having the tag/data entry table 48 nearthe cache data memory 42 may be desirable, and thus a separate table maybe implemented.

It is noted that the tag memory 42 has been described as storing anaddress tag. Any portion of the address may form the address tag,including all of the address. For example, in fully associativeembodiments, all of the address may be stored (or all of the addressexcept for the least significant bits that define an offset in a cacheblock). In direct-mapped or set associative embodiments, the address tagmay exclude the portion of the address used as an index (and may alsoexclude the offset bits).

It is noted that, while the IOC 26 is described above as having entriesthat may be allocated as staging buffers or cache storage, other cachesmay implement similar functionality. For example, caches in theprocessors 18A-18B may implement such functionality. In such a cache,the source of transactions may be the processor core's load/storefunctionality, instead of various I/O devices (through the IOB/IOM, inthe illustrated embodiment). Furthermore, the L2 cache 28 may implementsuch functionality.

Turning now to FIG. 6, a flow diagram is shown illustrating variousoperations of the IOC 26 for one embodiment. The IOC 26, and moreparticularly the cache control unit 44, may comprise circuitryimplementing the operation shown in FIG. 6. While the blocks are shownin a particular order for ease of understanding, other orders may beused. Blocks may be performed in parallel in combinatorial logic in theIOC 26/cache control unit 44. Blocks, combinations of blocks, and/or theflow diagram as a whole may represent multiple clock cycles ofoperation.

The IOC 26 may receive a transaction that includes data (e.g. from theinterconnect 30 or from an I/O device—block 60). If the transaction isnot cacheable (decision block 62, “no” leg), the allocated entry isbeing used as a staging buffer and thus the tag may be set to invalid(block 72). The IOC 26 may allocate an entry from the free list (block66), updating the free list to indicate that the entry has beenallocated. Additionally, the IOC 26 may write the transaction data tothe allocated entry (block 64). If the transaction is cacheable(decision block 62, “yes” leg) and if a data entry has already beenallocated for the transaction (decision block 68, “yes” leg), the IOC 26may update the tag state in the entry based on the coherence schemeimplemented on the interconnect 30 (block 69) and may write the data tothe allocated entry (block 64). The tag state may depend on variousresponses to the transaction, such as snoop responses, responses toprobes, etc. A block may already have been allocated for the data if thetransaction is cacheable and hits in the cache, or if the data is a fillfor a previous cache miss. Additionally, in some embodiments, an entrymay already have been allocated if a previous transaction having datawithin the boundaries of the same cache block has been provided, andmerging of the transactions is permissible. For example, writetransactions are mergeable in some systems.

If the transaction is cacheable (decision block 62, “yes” leg) and anentry has not already been allocated (decision block 68, “no” leg), theIOC 26 may set the tag state of a tag entry based on the coherencescheme implemented on the interconnect 30 (block 70) and may allocate anavailable entry from the free list (block 66). The IOC 26 may update thefree list to indicate that the entry has been allocated. As mentionedpreviously, data may be cacheable or uncacheable according totransaction type, software constraint, or policy of the IOC 26. In someembodiments, the decision of whether or not to cache a given block maybe deferred until the data entry is ready to be freed. For IS example, awrite operation that writes less than a cache block, and is merged inthe IOC 26 into a cache block of data read from memory, may be retainedin the cache to permit additional writes to occur. An I/O write of acomplete data block, on the other hand, may be written to memory anddeallocated from the cache.

If the IOC 26 detects that staged data is ready to be retransmitted toits target (decision block 74, “yes” leg), the IOC 26 may read thestaged data from the data entry and transmit the data (block 76). TheIOC 26 may return the data entry to the free list (block 78). That is,the IOC 26 may update the free list 46 to indicate that the data entryis available. The target for the data may be on the interconnect 30, ormay be an I/O device communicating through the IOB 22/IOM 24, dependingon the direction that the data is traveling.

If the IOC 26 detects that a cache block is to be evicted (decisionblock 80, “yes” leg), the IOC 26 may set the tag state to invalid (block82). If the evicted cache block is modified, the tag state may be set toinvalid once the evict-writeback transaction has been address-ordered onthe interconnect 30. Thus, the data entry storing the evicted data maybe converted to a staging buffer. If the evicted cache block ismodified, the IOC 26 may read the data from the entry when the data isready to be transmitted on the interconnect 30 and may transmit the data(block 76). The data entry is also returned to the free list (block 78).

The IOC 26 may also snoop coherent transactions from the interconnect30. Since data entries currently in use as staging buffers either havean invalid corresponding tag entry (or no tag entry at all, in the caseof the embodiment of FIG. 4), no snoop hit will be detected on suchentries. If a snoop hit is detected that causes the tag to beinvalidated (decision block 84, “yes” leg), the IOC 26 may set the tagstate to invalid (block 82). If the data is to be provided by the IOC 26in response to the snoop, the IOC 26 may read the data from the entryand transmit it on the interconnect 30 (block 76). In some cases, thedata is not provided (e.g. an invalidate transaction, used when thesource of the invalidate is going to overwrite the cache block). The IOC26 may return the entry to the free list (block 78). In some cases, thereturn to the free list may be delayed (e.g. if the data still needs tobe forwarded, such as a read completion to an I/O device). If a snoophit is detected that does not cause the tag to be invalidated (decisionblock 85, “yes” leg), the IOC 26 may update the tag state in accordancewith the coherence scheme implemented by the interconnect 30 and maysupply the data in response to the snoop, if necessary (block 86).

Not shown in FIG. 6 is the cacheable read cache hit case. If a readtransaction from an I/O device hits in the IOC 26, the IOC 26 providesdata from the hitting entry.

Numerous variations and modifications will become apparent to thoseskilled in the art once the above disclosure is fully appreciated. It isintended that the following claims be interpreted to embrace all suchvariations and modifications.

1. A cache comprising: a data memory comprising a plurality of dataentries, each data entry having capacity to store a cache block of data;a cache control unit coupled to the data memory, wherein the cachecontrol unit is configured to dynamically allocate a given data entry inthe data memory to store a cache block being cached or to store datathat is being staged for retransmission on an interface to which thecache is coupled, and wherein the cache control unit comprises a freelist, and wherein the cache control unit is configured to use the freelist to track which data entries in the data memory are currentlyallocated and which are currently free, and wherein the cache controlunit is configured to update the free list to indicate that the givendata entry is currently allocated responsive to allocating the givendata entry; and a tag memory coupled to the cache control unit, whereinthe tag memory comprises a plurality of tag entries configured to storeaddress tags corresponding to data in the data memory and validityindications, and wherein a combination of the free list value for thegiven data entry and the validity indication in the tag memory for thegiven data entry indicate a current state of the given data entry. 2.The cache as recited in claim 1 wherein, if the free list valueindicates that the given data entry is free, the given data entry isavailable for allocation.
 3. The cache as recited in claim 1 wherein, ifthe free list value indicates that the given data entry is allocated andthe validity indication indicates invalid, the given data entry isallocated to store staged data.
 4. The cache as recited in claim 3wherein the interface is a coherent interconnect, and wherein the tagmemory is snooped to maintain coherency, and wherein a snoop hit is notdetected on staged data since the tag is marked invalid.
 5. The cache asrecited in claim 1 wherein, if the free list value indicates that thegiven data entry is allocated and the validity indication indicatesvalid, the given data entry is allocated to store a cache block.
 6. Thecache as recited in claim 1 wherein the validity indication comprises acache state including at least an invalid state and a shared state. 7.The cache as recited in claim 1 wherein the cache control unit isconfigured to update the free list to indicate that the given data entryis currently free if the given data entry is storing staged data and thestaged data has been retransmitted.
 8. The cache as recited in claim 1wherein, if the given data entry is storing cache data and the cachedata is evicted, the cache control unit is configured to set thevalidity indication in the tag memory to invalid to convert the givendata entry from a cache entry to a staging buffer.
 9. The cache asrecited in claim 8 wherein the cache control unit is configured toupdate the free list to indicate the given data entry is currently freeresponsive to transferring the evicted data.
 10. The cache as recited inclaim 1 further comprising a table that maps the tag entries in the tagmemory to the data entries in the data memory, wherein the cache controlunit is configured to create the mapping responsive to allocating a dataentry for cache block storage.
 11. The cache as recited in claim 10wherein the table is congruent to the tag memory.
 12. The cache asrecited in claim 1 wherein the cache is coupled to a second interface,and wherein the cache is configured to receive the staged data forretransmission from the second interface.
 13. The cache as recited inclaim 12 wherein the cache is configured to receive data from is theinterface for retransmission on a second interface, and wherein thecache is configured to allocate a data entry to store the data.
 14. Amethod comprising: receiving data in a cache, the data being staged forretransmission on an interface to which the cache is coupled;dynamically allocating a given data entry in a data memory of the cacheto store the staged data, the given data entry having a capacity tostore a cache block being cached and also useable to cache the cacheblock; tracking which of the data entries in the data memory arecurrently allocated to either cache blocks or staged data and whichentries are free in a free list, the tracking comprising updating thefree list to indicate that the given data entry is allocated to thestaged data; maintaining cache tags for the data entries in a tag memorythat comprises a plurality of tag entries configured to store addresstags corresponding to data in the data memory and validity indications,wherein a combination of validity indication in the tag memory for thegiven data entry and a state in the free list indicates whether thegiven data entry is storing staged data or a cache block.
 15. The methodas recited in claim 14 wherein the given data entry being available forallocation is indicated by the free list value indicating that the givendata entry is free.
 16. The method as recited in claim 15 wherein thegiven data entry being allocated to store staged data is indicated by acombination of the free list value indicating that the given entry isallocated and the validity indication indicating invalid.
 17. The methodas recited in claim 16 wherein the given data entry being allocated tostore a cache block is indicated by a combination of the free list valueindicating that the given entry is allocated and the validity indicationindicating valid.